java从字符串执行方法
我有一个字符串,其中包含带参数的方法名。我想执行所有的方法。我该怎么做呢。考虑以下输入-
String s="second(first(\"string1\"))";
其中first(String s)
和second(String s)
是我的类中的两个方法
请注意,当我手动更改Strings s=second(first("string1"));
时,它工作正常,我正在寻找一些动态方法来完成同样的操作
(如果可能,则无需思考)
你可以在下面搜索框中键入要查询的问题!
我有一个字符串,其中包含带参数的方法名。我想执行所有的方法。我该怎么做呢。考虑以下输入-
String s="second(first(\"string1\"))";
其中first(String s)
和second(String s)
是我的类中的两个方法
请注意,当我手动更改Strings s=second(first("string1"));
时,它工作正常,我正在寻找一些动态方法来完成同样的操作
(如果可能,则无需思考)
共 (0) 个答案